package org.pjlib.common;

import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.StringUtils;

/**
 * Created by ws on 2019/07/02.
 */
public class AppKey {
    public static String appKey;
    public static SPUtils spUtils;

    public static SPUtils getSp() {
        if (spUtils == null) {
            spUtils = SPUtils.getInstance("LBUserInfo");
        }
        return spUtils;
    }
    public static void putAppKey(String appkey) {
        AppKey.appKey = appkey;
        getSp().put("appkey", appKey);
    }

    public static String getAppKey() {
        if (StringUtils.isEmpty(appKey)) {
            appKey = getSp().getString("appkey");
        }
        return appKey;
    }
    public static void clear(){
        putAppKey("");
        getSp().clear();
    }
}
